.class public Lcom/vividsolutions/jts/geomgraph/EdgeList;
.super Ljava/lang/Object;
.source "EdgeList.java"


# instance fields
.field private edges:Ljava/util/List;

.field private index:Lcom/vividsolutions/jts/index/SpatialIndex;


# direct methods
.method public constructor <init>()V
    .locals 1

    .line 63
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 51
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/vividsolutions/jts/geomgraph/EdgeList;->edges:Ljava/util/List;

    .line 61
    new-instance v0, Lcom/vividsolutions/jts/index/quadtree/Quadtree;

    invoke-direct {v0}, Lcom/vividsolutions/jts/index/quadtree/Quadtree;-><init>()V

    iput-object v0, p0, Lcom/vividsolutions/jts/geomgraph/EdgeList;->index:Lcom/vividsolutions/jts/index/SpatialIndex;

    return-void
.end method


# virtual methods
.method public add(Lcom/vividsolutions/jts/geomgraph/Edge;)V
    .locals 2

    .line 71
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/EdgeList;->edges:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 72
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/EdgeList;->index:Lcom/vividsolutions/jts/index/SpatialIndex;

    invoke-virtual {p1}, Lcom/vividsolutions/jts/geomgraph/Edge;->getEnvelope()Lcom/vividsolutions/jts/geom/Envelope;

    move-result-object v1

    invoke-interface {v0, v1, p1}, Lcom/vividsolutions/jts/index/SpatialIndex;->insert(Lcom/vividsolutions/jts/geom/Envelope;Ljava/lang/Object;)V

    return-void
.end method

.method public findEqualEdge(Lcom/vividsolutions/jts/geomgraph/Edge;)Lcom/vividsolutions/jts/geomgraph/Edge;
    .locals 3

    .line 93
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/EdgeList;->index:Lcom/vividsolutions/jts/index/SpatialIndex;

    invoke-virtual {p1}, Lcom/vividsolutions/jts/geomgraph/Edge;->getEnvelope()Lcom/vividsolutions/jts/geom/Envelope;

    move-result-object v1

    invoke-interface {v0, v1}, Lcom/vividsolutions/jts/index/SpatialIndex;->query(Lcom/vividsolutions/jts/geom/Envelope;)Ljava/util/List;

    move-result-object v0

    .line 95
    invoke-interface {v0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :cond_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_1

    .line 96
    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/vividsolutions/jts/geomgraph/Edge;

    .line 97
    invoke-virtual {v1, p1}, Lcom/vividsolutions/jts/geomgraph/Edge;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_0

    return-object v1

    :cond_1
    const/4 p1, 0x0

    return-object p1
.end method

.method public getEdges()Ljava/util/List;
    .locals 1

    .line 82
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/EdgeList;->edges:Ljava/util/List;

    return-object v0
.end method
